<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<html>
	<head>
		<title>商家管理</title>
	

		<script>
	$(document).ready(function() {
		//聚焦第一个输入框
		$("#customers_customerName").focus();
		//为inputForm注册validate函数
		$("#inputForm").validate();
	});
	
</script>
	</head>

	<body>
	<section class="content">
<div class="row">
		<div class="col-md-12">

			<!-- Primary box -->
			<div class="box box-solid box-primary">
				<div class="box-header">
					<i class="fa fa-edit"></i>
					<h3 class="box-title">管理商家</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
				<div class="box-body">
		<form id="inputForm" action="${ctx}/v2/customers/${action}" method="post"
			class="form-horizontal">
			<input type="hidden" name="id" value="${customers.id}" />
			<fieldset>
			<div class="form-group row">
					<label for="customers_customerName" class="col-sm-3 control-label">
						商家名称:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_customerName" name="customerName"
							value="${customers.customerName}" class="form-control  required"
							minlength="1" />
				</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_customerCode" class="col-sm-3 control-label">
						商家编码:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_customerCode" name="customerCode"
							value="${customers.customerCode}" class="form-control  required"
							minlength="1" />
				</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_sectionPo" class="col-sm-3 control-label">
						分仓宝:
					</label>
					<div class="col-sm-6">
						<input type="radio" class="form-control" value="1" name="sectionPo" <c:if test="${customers.sectionPo eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" class="form-control" value="0" name="sectionPo" <c:if test="${customers.sectionPo eq '0'}">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_placeStatus" class="col-sm-3 control-label">
						订单流入限制:
					</label>
					<div class="col-sm-6">
						<input type="radio" value="1" name="placeStatus" <c:if test="${customers.placeStatus eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" value="0" name="placeStatus" <c:if test="${customers.placeStatus eq '0'}">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_placeStatus" class="col-sm-3 control-label">
						是否减库存:
					</label>
					<div class="col-sm-6">
						<input type="radio" value="1" name="subStock" <c:if test="${customers.subStock eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" value="0" name="subStock" <c:if test="${customers.subStock eq '0'}">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_passBack" class="col-sm-3 control-label">
						是否回传运单号:
					</label>
					<div class="col-sm-6">
						<input type="radio" value="1" name="passBack" <c:if test="${customers.passBack eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" value="0" name="passBack" <c:if test="${customers.passBack eq '0'}">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_passBack" class="col-sm-3 control-label">
						是否打印随箱单:
					</label>
					<div class="col-sm-6">
						<input type="radio" value="1" name="packStatus" <c:if test="${customers.packStatus eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" value="0" name="packStatus" <c:if test="${customers.packStatus eq '0'}">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_passBack" class="col-sm-3 control-label">
						是否开通奇门:
					</label>
					<div class="col-sm-6">
						<input type="radio" value="1" name="openQm" <c:if test="${customers.openQm eq '1'}">checked</c:if> >是
						<span style="margin: 20px 20px;"></span>
						<input type="radio" value="0" name="openQm" <c:if test="${customers.openQm eq '0' || empty customers.openQm }">checked</c:if> >否
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_forwardSign" class="col-sm-3 control-label">
						中转发识别:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_forwardSign" name="forwardSign"
							value="${customers.forwardSign}" class="form-control input-large required"
							minlength="1" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_startPoint" class="col-sm-3 control-label">
						商家所在地编码:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_startPoint" name="startPoint"
							value="${customers.startPoint}" class="form-control input-large required"
							minlength="1" />
					</div>
				</div>

				<div class="form-group row">
					<label for="ordenoSynchroInf" class="col-sm-3 control-label">
						订单同步接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="ordenoSynchroInf" name="ordenoSynchroInf"
							value="${customers.ordenoSynchroInf}"
							class="form-control input-large required" minlength="2" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="ordenoChartInf" class="col-sm-3 control-label">
						订单报表接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="ordenoChartInf" name="ordenoChartInf"
							value="${customers.ordenoChartInf}"
							class="form-control input-large required" minlength="2" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="skuSourceInf" class="col-sm-3 control-label">
						商品信息接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="skuSourceInf" name="skuSourceInf"
							value="${customers.skuSourceInf}"
							class="form-control input-large required" minlength="2" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_forwardBatchAddress" class="col-sm-3 control-label">
						中转发出库批次接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_forwardBatchAddress"
							name="forwardBatchAddress" value="${customers.forwardBatchAddress}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>

				<div class="form-group row">
					<label for="customers_tmsBatchAddress" class="col-sm-3 control-label">
						出库批次接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_tmsBatchAddress"
							name="tmsBatchAddress" value="${customers.tmsBatchAddress}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_tmsBatchAppkey" class="col-sm-3 control-label">
						出库批次appKey:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_tmsBatchAppkey"
							name="tmsBatchAppkey" value="${customers.tmsBatchAppkey}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_tmsBatchAppsecret" class="col-sm-3 control-label">
						出库批次appSecret:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_tmsBatchAppsecret"
							name="tmsBatchAppsecret" value="${customers.tmsBatchAppsecret}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				<div class="form-group row">
					<label for="customers_areasGroupInf" class="col-sm-3 control-label">
						网点接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_areasGroupInf"
							name="areasGroupInf" value="${customers.areasGroupInf}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				<div class="form-group row">
					<label for="customers_cancelUrl" class="col-sm-3 control-label">
						取消单接口:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_cancelUrl"
							name="cancelUrl" value="${customers.cancelUrl}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				<div class="form-group row">
					<label for="customers_areasUsername" class="col-sm-3 control-label">
						网点用户名:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_areasUsername"
							name="areasUsername" value="${customers.areasUsername}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				<div class="form-group row">
					<label for="customers_areasPassword" class="col-sm-3 control-label">
						网点密码:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_areasPassword"
							name="areasPassword" value="${customers.areasPassword}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				
				<c:if test="${action eq 'create' }">
				<div class="form-group row">
					<label for="customers_startOrdeno" class="col-sm-3 control-label">
						起始订单号:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_startOrdeno"
							name="startOrdeno" value="${customers.startOrdeno}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				<div class="form-group row">
					<label for="customers_startNumber" class="col-sm-3 control-label">
						运单号前缀:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_startNumber"
							name="startNumber" value="${customers.startNumber}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				
				<div class="form-group row">
					<label for="customers_endNumber" class="col-sm-3 control-label">
						运单号后缀:
					</label>
					<div class="col-sm-6">
						<input type="text" id="customers_endNumber"
							name="endNumber" value="${customers.endNumber}"
							class="form-control input-large required" minlength="1" />
					</div>
				</div>
				</c:if>
				<div class="form-group row">
					<label for="customers_email" class="col-sm-3 control-label">
						邮箱:
					</label>
					<div class="col-sm-6">
					<input type="text" id="customers_email"
							name="email" value="${customers.email}"
							class="form-control input-large required" minlength="1" ></input>
					</div>
						<font color='red'>多个邮箱请以逗号【,】隔开</font>
				</div>
				<div class="form-group row">
					<label for="customers_customerIntro" class="col-sm-3 control-label">
						商家介绍:
					</label>
					<div class="col-sm-6">
					<textarea rows="5" id="customers_customerIntro"
							name="customerIntro" value="${customers.customerIntro}"
							class="form-control input-large required" minlength="1" ></textarea>
						
					</div>
				</div>

				<div class="modal-footer bg-gray">
					<input id="submit_btn" class="btn btn-primary" type="submit"
						value="提交" />
					&nbsp;
					<input id="cancel_btn" class="btn" type="button" value="返回"
						onclick="history.back()" />
				</div>
			</fieldset>
		</form>
		<script type="text/javascript">
		  $("#customers_customerIntro").val('${customers.customerIntro}');
		</script>
		</div>
		</div>
		</div>
		</div>
		</section>
	</body>
</html>
